/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Hnmtuan
 */
@Embeddable
public class Order1PK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idOrder")
    private String idOrder;
    @Basic(optional = false)
    @Column(name = "Customer")
    private String customer;

    public Order1PK() {
    }

    public Order1PK(String idOrder, String customer) {
        this.idOrder = idOrder;
        this.customer = customer;
    }

    public String getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(String idOrder) {
        this.idOrder = idOrder;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOrder != null ? idOrder.hashCode() : 0);
        hash += (customer != null ? customer.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Order1PK)) {
            return false;
        }
        Order1PK other = (Order1PK) object;
        if ((this.idOrder == null && other.idOrder != null) || (this.idOrder != null && !this.idOrder.equals(other.idOrder))) {
            return false;
        }
        if ((this.customer == null && other.customer != null) || (this.customer != null && !this.customer.equals(other.customer))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.Order1PK[idOrder=" + idOrder + ", customer=" + customer + "]";
    }

}
